package com.dengyuanke.upms.domain.feign;

import com.dengyuanke.common.core.constant.SecurityConstants;
import com.dengyuanke.common.core.constant.ServiceNameConstants;
import com.dengyuanke.common.core.result.R;
import com.dengyuanke.upms.domain.dto.UserInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @author dengyuanke
 * @since 2019-06-29
 */
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.UMPS_SERVICE,fallback=RemoteUserServiceFallback.class)
public interface RemoteUserService {
	/**
	 * 通过用户名查询用户、角色信息
	 *
	 * @param username 用户名
	 * @return R
	 */
	@GetMapping("/user/info/{username}")
	R<UserInfo> info(@PathVariable("username") String username,@RequestHeader(SecurityConstants.FROM) String from);

}
